<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script src='vue.js'></script>
</head>
<body>
	<style>
		.activated {
			color: red
		}
	</style>

	<div id="app">
		<div @click="handleDivClick" 
			 :class="{activated: isActived}">
			hello world
		</div>
		<div @click="handleDivClick1" 
			 :class="[activated, activatedOne]">
			hello world1
		</div>
		<div @click="handleDivClick2" 
			 :style="[styleObj, styleObj1]">
			hello world1
		</div>
	</div>

	<script>
		var vm = new Vue({
			el: '#app',
			data: {
				isActived: false,
				activated: '',
				activatedOne: 'activated-one',
				styleObj: {
					color: 'blue'
				},
				styleObj1: {
					fontSize: '28px'
				}
			},
			methods: {
				handleDivClick () {
					this.isActived = !this.isActived;
				},
				handleDivClick1 () {
					this.activated = this.activated === 'activated' ? '' : 'activated';
				},
				handleDivClick2 () {
					this.styleObj.color = 'red';	
				}
			}
		})

		
	</script>
</body>
</html>